package him.action.board;

import him.action.Action;
import him.action.ActionForward;
import him.dto.bbs.BoardRepDto;
import him.dto.login.LoginDTO;
import him.service.BoardRepService;
import him.serviceimple.BoardRepServiceImp;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;



public class BoardListAction implements Action {

	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		ActionForward forward=new ActionForward();
		BoardRepService service=BoardRepServiceImp.getInstance();
		
		List<BoardRepDto> boardDtos=service.getAllBoards();
		request.setAttribute("lists",boardDtos);
		LoginDTO dto1 =(LoginDTO) request.getSession().getAttribute("login");
		System.out.println(dto1);
		request.setAttribute("dto", dto1);
		forward.setUrl("list");
		
		return forward;
	}

}
